1. Field of the Invention
The present invention relates to still image and a moving image processing, and more particularly to an apparatus and a method for analyzing a histogram, which represents the luminance characteristic and the contrast characteristic according to RGB colors of an image, and a luminance compensation apparatus using the same.
2. Description of the Related Art
In processing a still image and/or a moving image, it is necessary understand the characteristics of each corresponding image in order to apply a specific algorithm. In order to understand the characteristics of an image, a histogram analysis, which represents the luminance and contrast according to RGB colors of an image, is generally used.
According to the conventional computation method using luminance in order to analyze a histogram, luminance values of each pixel constituting a corresponding image in an input image are calculated, and the number of pixels having a corresponding luminance value is determined. The histogram is computing the number of pixels having a particular luminance value against the luminance values. Accordingly, the number of pixels as a function of specific luminance value is expressed in a graph by the histogram. In this case, when data of an input image correspond to data of an RGB domain, a histogram is computed after the data is mapped to a color space from which luminance components of the data can be extracted, or a histogram is computed with respect to each of RGB. Generally, the histogram computed as described above is used by converting histogram distribution into a monotonically increasing function, by accumulating the histogram distribution through a cumulative distribution function (CDF).
FIG. 1 is a block diagram schematically illustrating the construction of a conventional luminance compensation apparatus using a histogram analysis. The conventional luminance compensation apparatus includes a histogram analysis unit 10, a luminance compensation function generation unit 11, and a mapping unit 13. The histogram analysis unit 10 includes a probability density function (PDF) operator, calculates luminance values of each pixel constituting a corresponding image in an input image, and calculates the number of pixels corresponding to each luminance value, thereby analyzing a histogram. The luminance compensation function generation unit 11 includes a cumulative distribution function (CDF), computes a cumulative distribution of a histogram, and generates a mapping function for luminance compensation based on the computed cumulative distribution. The mapping unit 13 compensates luminance values of an input image according to the mapping function generated by the luminance compensation function generation unit 11.
FIGS. 2A to 2C are graphs illustrating an exemplary histogram, cumulative distribution function, and mapping function of an image, respectively. As shown in FIG. 2A, a histogram is obtained by classifying luminance values of an input image into 0 to 255 and making a graph showing the number of pixels as a function of each luminance value. FIG. 2B shows a cumulative distribution function generated by the luminance compensation function generation unit 11. In this case, for example, when an input image has a resolution of 720×480, the cumulative distribution function has 345,600 final cumulative values. FIG. 2C shows a mapping function, which may be a function obtained by converting the cumulative distribution function into a 256-level gray scale. Consequently, such a mapping function has output luminance values corresponding to luminance values of input pixels.
FIG. 3 is a view illustrating an image frame for explaining a general histogram analysis method for an image. As indicated by the arrows in FIG. 3, when analyzing a histogram for an input image, the histogram analysis unit 10 uses a so-called pixel-by-pixel analysis method in which all pixels constituting the image are sequentially examined.
However, such an analysis method requires a large amount of calculation for analysis of a large still image or a high-resolution moving image. Particularly, devices such as mobile terminals have recently shown a tendency to reproduce a digital multimedia broadcasting (DMB) signal and a moving-image file, and also to be equipped with a liquid crystal display (LCD) capable of displaying a high-resolution image. Therefore, when the histogram analysis method as described above is used to analyze a high-resolution moving image or the like in a mobile terminal having a relatively poorer calculation capability, there is a problem in that a great amount of hardware resources are required.